{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/hyb_o2o/template/public/ygcss.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}

    .store_td1{height: 45px;}

    .store_list_img{width: 60px;height: 60px;}

    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;text-align: center;}

    .yg5_tr2>td{padding: 15px;border: 1px solid #e5e5e5;}

    .yg5_tr1>td{

        border: 1px solid #e5e5e5;
        background-color: #FAFAFA;
        padding: 8px;
        font-weight: bold;

    }

    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
    .check_img{width: 45px;height: 45px;}
    .ygrow{margin-top: 20px;}
    .yghuise{background-color: grey;color: white;}
    .yghuise:hover{background-color: grey;color: white;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li {if $op == 'display'} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'display'))}">门店服务</a></li>
    <li {if $op == 'displays'} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'displays'))}">商家服务</a></li>
    <li {if $op == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'post'))}">添加门店服务</a></li>
</ul>
{if $op =="display"}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
        <form action="" method="post" class="col-md-4" style="display: flex;">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="hyb_o2o" />
            <input type="hidden" name="do" value="fuwu" />
            <input type="hidden" name="op" value="display" />
            <div>
                <div class="input-group" style="width: 300px">
                    <input type="text" name="keywords" class="form-control" placeholder="请输入服务名称">
                </div>
            </div>
            <span class="input-group-select" style="margin-left: 20px;">
              <select name="type" class="form-control" style="width:300px;padding:0 5px;">
                <option value="">所属分类</option>
                {loop $fenlei $item}
                <option value="{$item['xt_id']}">{$item['xt_name']}</option>
                {/loop}
              </select>
            </span>
            <span class="input-group-btn" style="margin-left: 20px;">
                <input type="submit" class="btn btn-default" name="submit" value="搜索"/>
            </span>
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">服务列表</div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
            <form  action="" method="post">
            <table class="yg5_tabel col-md-12">
                    <tbody>
                    <tr class="yg5_tr1">
                        <td class="store_td1 col-md-1">
                            <input class="allcheck" type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});">
                            <span class="store_inp">全选</span>
                        </td>
                            <td class="">排序</td>
                             <td class="">项目名称</td>
                            <!--  <td class="">项目图片</td> -->
                            <td class="col-md-1">所属分类</td>
                            <td class="col-md-1">所属商家</td>
                           <td class="col-md-1">服务模式</td>       
                            <td class="col-md-1">服务价格</td>
                           <td class="col-md-1">项目单位</td>
                            <td class="col-md-1">销量</td>
                            <td class="col-md-1">是否上架</td>
                            <td class="col-md-1">是否推荐</td>
                           <td class="col-md-2">操作</td>
                        </tr>
                        {loop $products $item}
                        <tr class="yg5_tr2" >
                            <td>
                            <input  type="checkbox" name="all[]" value="{$item['x_id']}">
                        </td>
                        <td class="store_td1 col-md-1">{$item['x_id']}</td>
                           <!--  <td>
                                {$item['x_id']}
                            </td> -->
                             <td class="col-md-1">
                                {$item['x_name']}
                            </td>
                        <!--   <td class="col-xs-1">
                            {if strpos($item['x_thumb'],"http")===false}
                           <img class="store_list_img" src="{media $item['x_thumb']}" alt="">
                            {else}
                           <img class="store_list_img" src="{$item['x_thumb']}" alt="">
                            {/if}
                            </td> -->
                           <td class="col-md-1">
                           <span class="label storesuccess">{$item['xt_name']}</span>
                            </td>
                          <td class="col-md-1">
                                <span class="btn btn-xs ygyouhui">{$item['sj']}</span>
                            </td>
                            <td class="col-md-1">
                               <span class="btn btn-xs storewarning"> {$item['x_xingshi']}</span>
                            </td>
                           <td class="col-md-1 wm_money1">
                               ￥ {$item['x_jiage']}
                            <td class="col-md-1 wm_money1">
                                {$item['x_danwei']}
                            </td>
                            <td class="col-md-1 wm_money1">
                                {$item['x_xiaoliang']}
                            </td>
                           
                            <td class="col-md-1 dish_btn">
                               {if $item['x_status'] == "1"}
                               <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_status'=>'0', 'op' =>'zhuang'))}" class="storespan btn btn-xs">
                                   
                                     <span class="yglabel" style="color: red">点击下架
                                       
                                    </span>
                                </a>
                               {elseif  $item['x_status']=="0"}
                                <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_status'=>'1', 'op' =>'zhuang'))}" class="storespan btn btn-xs">
                                    
                                     <span class="yglabel" style="color: green">点击上架
                                       
                                    </span>
                                </a>
                               {/if}
                            </td>
                            <td class="col-md-1 dish_btn">
                               {if $item['x_tuijian'] == "1"}
                               <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_tuijian'=>'0', 'op' =>'zhuangs'))}" class="storespan btn btn-xs">
                                   
                                     <span class="yglabel" style="color: red">点击不推荐
                                       
                                    </span>
                                </a>
                               {elseif  $item['x_tuijian']=="0"}
                                <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_tuijian'=>'1', 'op' =>'zhuangs'))}" class="storespan btn btn-xs">
                                    
                                    <span class="yglabel" style="color: green">点击推荐
                                       
                                    </span>
                                </a>
                               {/if}
                            </td>
                          <td class="col-md-2 dish_btn">
                                <a href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'], 'op' =>'post'))}"  class="storespan btn btn-xs">
                                    <span class="fa fa-pencil"></span>
                                    <span class="bianji">编辑
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                                <a href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'], 'op' => 'delete'))}" class="storespan btn btn-xs">
                                    <span class="fa fa-trash-o"></span>
                                    <span class="bianji">删除
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                            </td>
                        </tr>
                        {/loop}
                        <tr>
                            <td colspan="12" style="text-align: left;">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量上架">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量下架">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量推荐">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量不推荐">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量删除">
                            </td>
                        </tr>
                    </table>
                    </form>
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
     {$pager}
</div>
{/if}
{if $op == "post"}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                添加服务
            </div>
<!--             <div class="panel-heading wyheader">
                <ul class="nav nav-tabs">
                    {if empty($x_id)}
                    <li {if $op=='post' && $typs=="display"} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'post','typs'=>'display'))}">项目设置</a></li>
                    <li {if $op=='post' && $typs=="post"} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'post','typs'=>'post'))}">项目营销</a></li>
                    {else}
                    <li {if $op=='post' && $typs=="display"} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'post','typs'=>'display','x_id'=>$x_id))}">项目设置</a></li>
                    <li {if $op=='post' && $typs=="post"} class="active" {/if}><a href="{php echo $this->createWebUrl('fuwu',array('op'=>'post','typs'=>'post','x_id'=>$x_id))}">项目营销</a></li>
                    {/if}
                </ul>
            </div>
            {if $op=='post' && $typs=="display"} -->
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">服务项目名称</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_name" id="x_name" value="{$items['x_name']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">服务项目名称</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1" >所属分类</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_type" id="x_type" class="form-control">
                            <option value="">--请选择--</option>
                            {loop $type $item}
                            <option value="{$item['xt_id']}" {if $item['xt_id']==$items["x_type"]}selected{/if} >{$item['xt_name']}</option>
                            {/loop}
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">所属分类</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">服务形式</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <label class="select_one">
                            <input type="radio" name="x_xingshi" id="x_xingshi" value="上门服务" {if $items['x_xingshi'] == '上门服务'} checked{/if} />上门服务
                            <input type="radio" name="x_xingshi" id="x_xingshi"  value="到店服务" {if $items['x_xingshi'] == '到店服务'} checked{/if} />到店服务
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">服务形式</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">服务项目缩略图</label>
                    <!-- <div class="col-sm-1"></div> -->
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        {php echo tpl_form_field_image('x_thumb', $items['x_thumb'])}
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">服务项目缩略图</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">服务项目幻灯片</label>
                    <!-- <div class="col-sm-1"></div> -->
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        {php echo tpl_form_field_multi_image('x_thumbs', $items['x_thumbs'])}
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">服务项目幻灯片</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1"  style="color: red">付款方式[必选]</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_pay_type" id="x_pay_type" class="form-control">
                            <option value="">--请选择--</option>
                            <option value="全额付款" {if $items['x_pay_type']=="全额付款"}selected{/if} >全额付款</option>
                            <option value="定金支付"  {if $items['x_pay_type']=="定金支付"}selected{/if} >定金支付</option>
                            <option value="上门估价" {if $items['x_pay_type']=="上门估价"}selected{/if} >上门估价</option>
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">付款方式[必选]</div>
                </div>
                <script type="text/javascript">
                    $("#x_pay_type").change(function(e){
                        if($("#x_pay_type").val()=="定金支付"){
                            $("#djzb").show()
                        }else{
                            $("#djzb").hide()
                        }
                        if($("#x_pay_type").val()=="上门估价"){
                            $("#smgj").show()
                        }else{
                            $("#smgj").hide()
                        }
                        if ($("#x_pay_type").val()=="上门估价") {  
                            if ($("input[name='x_xingshi']:checked").val()=="到店服务") {
                                alert("上门估价不支持到店服务")
                            }
                        }
                    })
                    $("input[name='x_xingshi']").change(function(e){
                        if ($("#x_pay_type").val()=="上门估价") {
                                alert("上门估价不支持到店服务")
                        }
                    })
                </script>
                <div class="form-group" style="margin-left: 30px;display: none" id="djzb">
                    <label for="" class="control-label col-sm-1">定金占比</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_pay_bili" " value="{$items['x_pay_bili']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">定金占比(单位: %) </div>
                </div>
<!--                 {if $items['x_pay_type']=="定金支付"}
                <div class="form-group" style="margin-left: 30px;display: block;" id="djzb">
                    <label for="" class="control-label col-sm-1">定金占比</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_pay_bili" " value="{$items['x_pay_bili']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">定金占比(单位: %) </div>
                </div>
                {/if} -->
                <div class="form-group" style="margin-left: 30px;display: none" id="smgj">
                    <label for="" class="control-label col-sm-1">上门估价</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_pay_smgj" " value="{$items['x_pay_smgj']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">上门估价费用(单位: 元) </div>
                </div>
                {if $items['x_pay_type']=="上门估价"}
                <div class="form-group" style="margin-left: 30px;display: block" id="smgj">
                    <label for="" class="control-label col-sm-1">上门估价</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_pay_smgj" " value="{$items['x_pay_smgj']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">上门估价费用(单位: 元) </div>
                </div>
                {/if}
                <div class="form-group" style="margin-bottom: 0px;margin-left: 30px">
                    <label for="" class="control-label col-sm-1">添加服务规格</label>                
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">                   
                       <div class="spec-item col-xs-12 col-sm-12 col-md-12" style="padding-left: 0;margin-bottom: 0px;">
                            <div class="form-group" style="margin-bottom: 0px;">
                                <div class="col-sm-12 col-md-12 col-lg-12">
                                    <div class="input-group" style="margin-bottom: 10px;">
                                        <input name="spec" class="form-control spec_title" type="text" placeholder="规格名称 (比如: 颜色)" value="{$items['x_guigename']}" />
                                        <div class="input-group-btn">
                                            <a class="btn btn-info add-specitem" id="add-spec" href="javascript:;"><i class="fa fa-plus"></i> 添加规格项</a>
                                        </div>
                                    </div>
                                    
                                    <style type="text/css">
                                        .df{
                                            display: flex;
                                            
                                        }
                                        #spec-box{
                                            margin-left: 0px;
                                        }
                                    </style>
                                    <div class="form-group" id="spec-box" >
                                       {if $items['x_guigenum']!=0}
                                            {loop $items['x_guigecontent'] $item}
                                            <div class="input-group col-sm-12 col-md-12 col-lg-12 df" style="margin-right:10px;margin-bottom:10px;">
                                                <input name="spec_title[]"  class="form-control spec_title" type="text" placeholder="请输入规格项名称" value="{$item['guigexiang']}" />
                                                <input name="spec_money[]" class="form-control spec_title" type="text" placeholder="请输入该规格项价钱" value="{$item['price']}" />
                                                <div class="input-group-btn del">
                                                    <a class="btn btn-danger" href="javascript:void(0);" ><i class="fa fa-remove"></i></a>
                                                </div> 
                                            </div> 
                                            {/loop}
                                       {/if}
                                    </div>
                                    <script type="text/javascript">
                                        $("#add-spec").click(function(){
                                             $("#spec-box").append('<div class="input-group col-sm-12 col-md-12 col-lg-12 df" style="margin-right:10px;margin-bottom:10px;"><input name="spec_title[]" '+ 'class="form-control spec_title" type="text" placeholder="请输入规格项名称" value="" />'+
                                                 '<input name="spec_money[]" '+ 'class="form-control spec_title" type="text" placeholder="请输入该规格项价钱" value="" />'+
                                               ' <div class="input-group-btn del">'+
                                                   ' <a class="btn btn-danger" href="javascript:void(0);" ><i class="fa fa-remove"></i></a>'+
                                                '</div> '+'</div> ')+'';
                                        });
                                         
                                        $("#spec-box").on("click","div.input-group-btn",function(){
                                            $(this).parent().remove();
                                         })
                                        
                                    </script>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 
                <div class="form-group" style="margin-bottom: 0px;margin-left: 30px">
                    <label for="" class="control-label col-sm-1">添加服务时间段</label>                
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">                   
                       <div class="spec-item col-xs-12 col-sm-12 col-md-12" style="padding-left: 0;margin-bottom: 0px;">
                            <div class="form-group" style="margin-bottom: 0px;">
                                <div class="col-sm-12 col-md-12 col-lg-12">
                                    <div class="input-group" style="margin-bottom: 10px;">
                                        <div class="input-group-btn">
                                            <a class="btn btn-info add-specitem" id="add-times" href="javascript:;"><i class="fa fa-plus"></i> 添加时间段</a>
                                        </div>
                                    </div>
                                    
                                    <style type="text/css">
                                        .df{
                                            display: flex;
                                            
                                        }
                                        #spec-box{
                                            margin-left: 0px;
                                        }
                                    </style>
                                    <div class="form-group" id="spec-box-time" >
                                       {if $items['x_timenum']!=0}
                                            {loop $items['x_timecontent']['start'] $k $item}
                                            <div class="input-group col-sm-12 col-md-12 col-lg-12 df" style="margin-right:10px;margin-bottom:10px;">
                                                <input name="spec_start_time[]"  class="form-control spec_start_time" type="text" placeholder="请输入服务起始时间" value="{$items['x_timecontent']['start'][$k]}" />
                                                <input name="spec_end_time[]" class="form-control spec_title" type="text" placeholder="请输入服务终止时间" value="{$items['x_timecontent']['end'][$k]}" />
                                                <input name="counts[]" class="form-control spec_title" type="text" placeholder="请输入该时间段可服务次数" value="{$items['x_timecontent']['counts'][$k]}" />
                                                <div class="input-group-btn del">
                                                    <a class="btn btn-danger" href="javascript:void(0);" ><i class="fa fa-remove"></i></a>
                                                </div> 
                                            </div> 
                                            {/loop}
                                       {/if}
                                    </div>
                                    <script type="text/javascript">
                                        $("#add-times").click(function(){
                                             $("#spec-box-time").append('<div class="input-group col-sm-12 col-md-12 col-lg-12 df" style="margin-right:10px;margin-bottom:10px;"><input name="spec_start_time[]" '+ 'class="form-control spec_title" type="text" placeholder="请输入服务起始时间" value="" />'+
                                                 '<input name="spec_end_time[]" '+ 'class="form-control spec_title" type="text" placeholder="请输入服务终止时间" value="" />'+
                                                 '<input name="counts[]" '+ 'class="form-control spec_title" type="text" placeholder="请输入该时间段可服务次数" value="" />'+
                                               ' <div class="input-group-btn del">'+
                                                   ' <a class="btn btn-danger" href="javascript:void(0);" ><i class="fa fa-remove"></i></a>'+
                                                '</div> '+'</div> ')+'';
                                        });
                                         
                                        $("#spec-box-time").on("click","div.input-group-btn",function(){
                                            $(this).parent().remove();
                                         })
                                        
                                    </script>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 


                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">简述</label>
                    
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">                   
                       <textarea rows="6" cols="20" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  name="x_content" id="x_content">{$items['x_content']}</textarea>
                       <!-- {php echo tpl_ueditor('x_content', $items['x_content']);} -->
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">简述</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">简述图片</label>
                    <!-- <div class="col-sm-1"></div> -->
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        {php echo tpl_form_field_multi_image('x_jianjie_thumb', $items['x_jianjie_thumb'])}
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">简述图片</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">温馨提示</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">                   
                       <textarea rows="6" cols="20" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  name="x_wenxintishi">{$items['x_wenxintishi']}</textarea>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">温馨提示</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">项目价格</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_jiage" id="x_jiage" value="{$items['x_jiage']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">项目价格</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">项目原价格</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_yjiage" id="x_yjiage" value="{$items['x_yjiage']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">项目原价格</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">单位</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_danwei" id="x_danwei" value="{$items['x_danwei']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">单位</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">项目销量</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_xiaoliang"  value="{$items['x_xiaoliang']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">项目销量</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1" style="color: red">一级分销比例</label>
                    <!-- <div class="col-sm-1"></div> -->
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="fx_yi" id="fx_yi" value="{$items['fx_yi']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">一级分销比例 （请输入小数 如：0.01） [空/0 不参与分销]</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1" style="color: red">二级分销比例</label>
                    <!-- <div class="col-sm-1"></div> -->
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="fx_er" id="fx_er" value="{$items['fx_er']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">二级分销比例 请输入小数 如：0.01） [空/0 不参与分销]</div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1" >是否上架</label>
                     <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <label class="select_one">
                            <input type="radio" name="x_status"  value="1" {if $items['x_status'] == '1'} checked{/if} />是
                            <input type="radio" name="x_status"  value="0" {if $items['x_status'] == '0'} checked{/if} />否
                        </label>
                    </div>
                </div>
                <div class="form-group" style="margin-left: 30px;">
                    <label for="" class="control-label col-sm-1" >是否推荐</label>
                     <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <label class="select_one">
                            <input type="radio" name="x_tuijian"  value="1" {if $items['x_tuijian'] == '1'} checked{/if} />是
                            <input type="radio" name="x_tuijian"  value="0" {if $items['x_tuijian'] == '0'} checked{/if} />否
                        </label>
                    </div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启积分活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_jifenstatus" id="x_jifenopen" value="1" {if $items['x_jifenstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_jifenstatus" id="x_jifenclose" value="0" {if $items['x_jifenstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启积分活动</div>
                </div>
                <div class="form-group" id="x_jifen" style="margin-top: 20px; margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1">积分金额</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_jifen" value="{$items['x_jifen']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="请输入积分金额" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">积分金额[购买此服务获得积分]</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启满减活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_manjianstatus" id="x_manjianopen" value="1" {if $items['x_manjianstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_manjianstatus" id="x_manjianclose" value="0" {if $items['x_manjianstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启满减活动</div>
                </div>
                <div class="form-group" id="x_manjian" style="margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1" >请选择满减活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_manjian" id="x_manjian" class="form-control">
                            <option value="">--请选择--</option>
                            {loop $manjian $item}
                            <option value="{$item['m_id']}" {if $item['m_id']==$items["x_manjian"]}selected{/if} >满{$item['m_money']}减元{$item['j_money']}元</option>
                            {/loop}
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">请选择满减活动</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启会员优惠</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_huiyuanstatus" value="1" {if $items['x_huiyuanstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_huiyuanstatus" value="0" {if $items['x_huiyuanstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启会员优惠</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启优惠券活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_youhuiquanstatus" id="x_youhuiquanopen" value="1" {if $items['x_youhuiquanstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_youhuiquanstatus" id="x_youhuiquanclose" value="0" {if $items['x_youhuiquanstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启优惠券活动</div>
                </div>
                <div class="form-group" id="x_youhuiquan" style="margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1" >请选择优惠券</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_youhuiquan" id="x_youhuiquan" class="form-control">
                            <option value="">--请选择--</option>
                            {loop $youhuiquan $item}
                            <option value="{$item['y_id']}" {if $item['y_id']==$items["x_youhuiquan"]}selected{/if} >{$item['y_name']}</option>
                            {/loop}
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">请选择优惠券</div>
                </div>
                <script type="text/javascript">
                    $("#x_jifenopen").click(function(){
                        $("#x_jifen").show();
                    })
                    $("#x_jifenclose").click(function(){
                        $("#x_jifen").hide();
                    })
                    $("#x_manjianopen").click(function(){
                        $("#x_manjian").show();
                    })
                    $("#x_manjianclose").click(function(){
                        $("#x_manjian").hide();
                    })
                    $("#x_youhuiquanopen").click(function(){
                        $("#x_youhuiquan").show();
                    })
                    $("#x_youhuiquanclose").click(function(){
                        $("#x_youhuiquan").hide();
                    })
                </script>
            <!-- {/if} -->
<!--             {if $op=='post' && $typs=="post"}
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启积分活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_jifenstatus" id="x_jifenopen" value="1" {if $items['x_jifenstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_jifenstatus" id="x_jifenclose" value="0" {if $items['x_jifenstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启积分活动</div>
                </div>
                <div class="form-group" id="x_jifen" style="margin-top: 20px; margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1">积分金额</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="text" name="x_jifen" value="{$items['x_jifen']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="请输入积分金额" autocomplete="off">
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">积分金额[购买此服务获得积分]</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开启满减活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_manjianstatus" id="x_manjianopen" value="1" {if $items['x_manjianstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_manjianstatus" id="x_manjianclose" value="0" {if $items['x_manjianstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开启满减活动</div>
                </div>
                <div class="form-group" id="x_manjian" style="margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1" >请选择满减活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_manjian" id="x_manjian" class="form-control">
                            <option value="">--请选择--</option>
                            {loop $manjian $item}
                            <option value="{$item['m_id']}" {if $item['m_id']==$items["x_manjian"]}selected{/if} >满{$item['m_money']}减元{$item['j_money']}元</option>
                            {/loop}
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">请选择满减活动</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开会员优惠</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_huiyuanstatus" value="1" {if $items['x_huiyuanstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_huiyuanstatus" value="0" {if $items['x_huiyuanstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开会员优惠</div>
                </div>
                <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
                    <label for="" class="control-label col-sm-1">是否开优惠券活动</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <input type="radio" name="x_youhuiquanstatus" id="x_youhuiquanopen" value="1" {if $items['x_youhuiquanstatus'] == 1} checked="true"{/if}/> 是
                        <input type="radio" name="x_youhuiquanstatus" id="x_youhuiquanclose" value="0" {if $items['x_youhuiquanstatus'] == 0} checked="true"{/if}   /> 否
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block">是否开优惠券活动</div>
                </div>
                <div class="form-group" id="x_youhuiquan" style="margin-left: 30px; display: none;">
                    <label for="" class="control-label col-sm-1" >请选择优惠券</label>
                    <div class="form-controls col-sm-5" style="margin-left: 75px;">
                        <select name="x_youhuiquan" id="x_youhuiquan" class="form-control">
                            <option value="">--请选择--</option>
                            {loop $youhuiquan $item}
                            <option value="{$item['y_id']}" {if $item['y_id']==$items["x_youhuiquan"]}selected{/if} >{$item['y_name']}</option>
                            {/loop}
                        </select>
                    </div>
                    <div class="col-sm-1"></div>
                    <div class="form-controls col-sm-4 help-block" style="color: red">请选择优惠券</div>
                </div>
                <script type="text/javascript">
                    $("#x_jifenopen").click(function(){
                        $("#x_jifen").show();
                    })
                    $("#x_jifenclose").click(function(){
                        $("#x_jifen").hide();
                    })
                    $("#x_manjianopen").click(function(){
                        $("#x_manjian").show();
                    })
                    $("#x_manjianclose").click(function(){
                        $("#x_manjian").hide();
                    })
                    $("#x_youhuiquanopen").click(function(){
                        $("#x_youhuiquan").show();
                    })
                    $("#x_youhuiquanclose").click(function(){
                        $("#x_youhuiquan").hide();
                    })
                </script>
            {/if} -->
        <div class="form-group" style="margin-top: 20px;">
            <input name="x_id" value="{$x_id}" hidden="true" />
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>
<script type="text/javascript">
    {if $items['x_pay_type']=="定金支付"}
        $("#djzb").show()
    {/if}
    {if $items['x_jifenstatus'] == '1'}
         $("#x_jifen").show();
    {/if}
    {if $items['x_manjianstatus'] == '1'}
         $("#x_manjian").show();
    {/if}
    {if $items['x_youhuiquanstatus'] == '1'}
         $("#x_youhuiquan").show();
    {/if}
</script>
{/if}

{if $op =="displays"}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
        <form action="" method="post" class="col-md-4" style="display: flex;">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="hyb_o2o" />
            <input type="hidden" name="do" value="fuwu" />
            <input type="hidden" name="op" value="displays" />
            <div>
                <div class="input-group" style="width: 300px">
                    <input type="text" name="keywords" class="form-control" placeholder="请输入服务名称">
                </div>
            </div>
            <span class="input-group-select" style="margin-left: 20px;">
              <select name="type" class="form-control" style="width:300px;padding:0 5px;">
                <option value="">所属分类</option>
                {loop $fenlei $item}
                <option value="{$item['xt_id']}">{$item['xt_name']}</option>
                {/loop}
              </select>
            </span>
            <span class="input-group-btn" style="margin-left: 20px;">
                <input type="submit" class="btn btn-default" name="submit" value="搜索"/>
            </span>
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">服务列表</div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <form action="" method="post">
                  <table class="yg5_tabel col-md-12">
                    <tbody>
                    <tr class="yg5_tr1">
                        <td class="store_td1 col-md-1">
                            <input class="allcheck" type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});">
                            <span class="store_inp">全选</span>
                        </td>
                            <td class="col-md-1">排序</td>
                            <td class="col-md-1">项目名称</td>
                           <!--  <td class="col-md-1">项目图片</td> -->
                            <td class="col-md-1">所属分类</td>
                            <td class="col-md-1">所属商家</td>
                            <td class="col-md-1">服务模式</td>       
                            <td class="col-md-1">项目价格</td>
                            <td class="col-md-1">项目单位</td>
                            <td class="col-md-1">项目销量</td>
                            <td class="col-md-1">是否上架</td>
                            <td class="col-md-1">是否推荐</td>
                            <td class="col-md-2">操作</td>
                        </tr>
                        {loop $products $item}
                      <tr class="yg5_tr2" >
                            <td>
                            <input name="all[]" value="{$item['x_id']}" type="checkbox" >
                        </td>
                        <td class="store_td1 col-md-1">{$item['x_id']}</td>

                           <td class="col-md-1">
                                {$item['x_name']}
                            </td>
                         <!--   <td class="col-xs-1">
                            {if strpos($item['x_thumb'],"http")===false}
                            <img class="store_list_img" src="{media $item['x_thumb']}"  alt="">
                            {else}
                            <img class="store_list_img" src="{$item['x_thumb']}"  alt="">
                            {/if}
                            </td> -->
                          <td class="col-md-1">
                           <span class="label storesuccess">{$item['xt_name']}</span>
                            </td>
                          <td class="col-md-1">
                                <span class="btn btn-xs ygyouhui">{$item['sj']}</span>
                            </td>
                            <td class="col-md-1">
                               <span class="btn btn-xs storewarning"> {$item['x_xingshi']}</span>
                            </td>
                            <td class="col-md-1">
                                {$item['x_jiage']}
                            </td>
                             <td class="col-md-1 wm_money1">
                                {$item['x_danwei']}
                            </td>
                            <td class="col-md-1 wm_money1">
                                {$item['x_xiaoliang']}
                            </td>
                            <td>
                               {if $item['x_status'] == "1"}
                               <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_status'=>'0', 'op' =>'zhuang'))}" class="storespan btn btn-xs">
                                    
                                     <span class="yglabel" style="color: red">点击下架
                                      
                                    </span>
                                </a>
                               {elseif  $item['x_status']=="0"}
                                <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_status'=>'1', 'op' =>'zhuang'))}" class="storespan btn btn-xs">
                                   
                                     <span class="yglabel" style="color: green">点击上架
                                      
                                    </span>
                                </a>
                               {/if}
                            </td>
                            <td>
                               {if $item['x_tuijian'] == "1"}
                               <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_tuijian'=>'0', 'op' =>'zhuangs'))}" class="storespan btn btn-xs">
                                    
                                    <span class="yglabel" style="color: red">点击不推荐
                                      
                                    </span>
                                </a>
                               {elseif  $item['x_tuijian']=="0"}
                                <a  href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'],'x_tuijian'=>'1', 'op' =>'zhuangs'))}" class="storespan btn btn-xs">
                                   
                                    <span class="yglabel" style="color: green">点击推荐
                                       
                                    </span>
                                </a>
                               {/if}
                            </td>
                            <td>
                                <a href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'], 'op' =>'post'))}"  class="storespan btn btn-xs">
                                    <span class="fa fa-pencil"></span>
                                    <span class="bianji">编辑
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                                <a href="{php echo $this->createWeburl('fuwu', array('x_id' => $item['x_id'], 'op' => 'delete'))}" class="storespan btn btn-xs">
                                    <span class="fa fa-trash-o"></span>
                                    <span class="bianji">删除
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                            </td>
                        </tr>
                        {/loop}
                        <tr>
                            <td colspan="12" style="text-align: left;">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量上架">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量下架">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量推荐">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量不推荐">
                                <input class="storespan btn btn-xs" type="submit" name="submit" value="批量删除">
                            </td>
                        </tr>
                    </table>
                </from>
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
     {$pager}
</div>
{/if}
<script type="text/javascript">
    $(function(){
        $("#frame-2").show();
        $("#yframe-2").addClass("wyactive");
    })
</script>
{template "common/footer"}